package com.muyu.common.core.enums;

import lombok.Getter;

/**
 * 系统是否
 * @author dongzeliang
 * @version 1.0
 * @description: 系统是否
 * @date 2025/1/27 10:43
 */
@Getter
public enum SysWhetherEnum {

    /**
     * 系统是
     */
    YES("Y", "是"),
    /**
     * 系统否
     */
    NO("N", "否");
    private final String code;
    private final String info;

    SysWhetherEnum(String code, String info) {
        this.code = code;
        this.info = info;
    }

    /**
     * 判定为是
     * @param code 编码
     * @return 若为是返回true
     */
    public static boolean isYes(String code) {
        return YES.getCode().equals(code);
    }

    /**
     * 判定为否
     * @param code 编码
     * @return 若为否返回true
     */
    public static boolean isNo(String code) {
        return NO.getCode().equals(code);
    }
}
